package com.example.spring_boo_test1;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.UUID;

public class TestMain {
    public static void main(String[] args) {
        String paths = "/aaa/aa/a/a.avi";
        String aaa = paths.replaceAll("/a(?=\\.)", "/"+UUID.randomUUID().toString());
        System.out.println(aaa);



        String urlString = "https://www.example.com/path/index.html";
        try {
            URL url = new URL(urlString);
            String domain = url.getHost();
            System.out.println(domain);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
}
